from pygooglechart import Chart
from pygooglechart import SimpleLineChart
from pygooglechart import Axis

def create_chart(data):
	# Set the vertical range from 0 to 100
	max_y = 1

	# Chart size of 200x125 pixels and specifying the range for the Y axis
	chart = SimpleLineChart(250, 125, y_range=[0, max_y])

	chart.add_data(data)

	# Set the line colour to blue
	chart.set_colours(['0000FF', "FF0000"])

	# Set the vertical stripes
	chart.fill_linear_stripes(Chart.CHART, 0, 'CCCCCC', 0.2, 'FFFFFF', 0.2)

	# Set the horizontal dotted lines
	chart.set_grid(0, .25, .5, 5)

	# The Y axis labels contains 0 to 100 skipping every 25, but remove the
	# first number because it's obvious and gets in the way of the first X
	# label.
	left_axis = ['', '25%', '50%', '75%', '100%']
	chart.set_axis_labels(Axis.LEFT, left_axis)

	# X axis labels
	chart.set_axis_labels(Axis.BOTTOM, ['-4', '-3', '-2', 'Yesterday', 'Today'])
	
	return chart.get_url()